package com.easy.common;


    public class CommonResult {
        private int code;
        private String message;
        private Object data;

        public CommonResult(int code, String message, Object data) {
            this.code = code;
            this.message = message;
            this.data = data;
        }

        public static com.easy.common.CommonResult success(int code, String message, Object data) {
            return new com.easy.common.CommonResult(code, message, data);
        }
        public static com.easy.common.CommonResult success(int code, String message) {
            return new com.easy.common.CommonResult(code, message, null);
        }
        public static com.easy.common.CommonResult success(Object data) {
            return new com.easy.common.CommonResult(200, "操作成功", data);
        }
        public static com.easy.common.CommonResult success() {
            return new com.easy.common.CommonResult(200, "操作成功", null);
        }

        public static com.easy.common.CommonResult fail(int code, String message, Object data) {
            return new com.easy.common.CommonResult(code, message, data);
        }
        public static com.easy.common.CommonResult fail(int code, String message) {
            return new com.easy.common.CommonResult(code, message, null);
        }
        public static com.easy.common.CommonResult fail(String message) {
            return new com.easy.common.CommonResult(0,message, null);
        }
        public static com.easy.common.CommonResult fail(){
            return new com.easy.common.CommonResult(400,"操作失败",null);
        }


        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public Object getData() {
            return data;
        }

        public void setData(Object data) {
            this.data = data;
        }
    }


